

project( cvplot )

## include & link to OpenCV :
include_directories(${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIB_DIR})
link_libraries(${OpenCV_LIBS})

## include & link to Qt if defined:
if(QT4_FOUND)
    message(STATUS "Has Qt4")
    include(${QT_USE_FILE})
    link_libraries(${QT_LIBRARIES})
    add_definitions( -DHAS_QT4 )
endif()


## include project source directories:
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

## search files:
file(GLOB SRC_FILES "src/*.cpp")
file(GLOB INC_FILES "include/*.h")

## create dll :
add_definitions(-DCVPLOT_EXPORTS)
add_library( ${PROJECT_NAME} SHARED ${SRC_FILES} ${INC_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX ".d")

## installation :
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
install(FILES ${INC_FILES} DESTINATION include)
